<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
	<h:form id="suchform2">
	<rich:collapsiblePanel expanded="true">
	<f:facet name="header">suchen . . .</f:facet>
	<table class="searchTable">
		<tr>
			<td>Ersteller</td>
			<td><rich:inplaceSelect value="#{QuestionSheetOverviewViewBean.creator}" openOnEdit="true">
			<f:selectItems value="#{QuestionSheetOverviewViewBean.userIDList}"/>
			</rich:inplaceSelect></td>
			<td>Bezeichnung</td>
			<td><h:inputText value="#{QuestionSheetOverviewViewBean.bezeichnung}" />
			</td>
		</tr>
		<tr>
			<td colspan="4"><hr/></td>
		</tr>
		<tr>
			<td colspan="4"><center><a4j:commandButton id="searchButton" action="#{QuestionSheetOverviewViewBean.refreshFilteredView()}" value="suchen" execute="suchform2" render="table2 datascrolleroben2 datascrollerunten2" onbegin="#{rich:component('Loadingpopup')}.show();" oncomplete="#{rich:component('Loadingpopup')}.hide();"/></center></td>
		</tr>
	</table>
	</rich:collapsiblePanel>
	</h:form>
	<center><rich:dataScroller id="datascrolleroben2" for="table2" maxPages="10" stepControls="auto" render="datascrollerunten"/></center>
	<h:form id="questionSheetTableForm">
	
	<a4j:jsFunction  name="questionSheetupdateForm" actionListener="#{QuestionSheetOverviewViewBean.selectionListener}" action="#{QuestionSheetOverviewViewBean.innerCompShow()}" execute="questionSheetTableForm" render="questionSheetDetail">
    </a4j:jsFunction>
	<rich:extendedDataTable value="#{QuestionSheetOverviewViewBean.questionSheets}" binding="#{QuestionSheetOverviewViewBean.dataTable}"
            var="questionsSheets" id="table2" frozenColumns="4" rows="10"
             selectionMode="single" styleClass="questionOverviewTable"
            noDataLabel="keine Fragebögen verfügbar" keepSaved="false"
            rowClasses="rowstyle1,rowstyle2" selection="#{QuestionSheetOverviewViewBean.selection}" onrowdblclick="questionSheetupdateForm()">
            <f:facet name="header">
                <h:outputText value="Fragebögen" />
            </f:facet>
            <rich:column width="300px">
                <f:facet name="header">
                    <h:outputText value="Bezeichnung" />
                </f:facet>
			<h:outputText value="#{questionsSheets.bezeichnung}" />
		</rich:column>
            <rich:column width="150px">
                <f:facet name="header">
                    <h:outputText value="Ersteller" />
                </f:facet>
                <h:outputText value="#{questionsSheets.user.id}" />
            </rich:column>
            <rich:column width="150px">
                <f:facet name="header">
                    <h:outputText value="Anzahl Fragen" />
                </f:facet>
                <h:outputText value="#{questionsSheets.fragen.size()}"/>
            </rich:column>
        </rich:extendedDataTable>
        <center><rich:dataScroller id="datascrollerunten2" for="table2" maxPages="10" stepControls="auto" render="datascrolleroben"/></center>														
        </h:form>
		
		<ui:include src="ChangeQuestionSheetInnerComp.xhtml"/>
		
</ui:composition>
